<template>
  <a-modal
    :title="title"
    :visible="visible"
    :confirm-loading="loading"
    :width="720"
    @ok="modalOK"
    @cancel="cancelModal"
  >
    <!-- @ok="() => { $emit('cancel') }" -->
    <a-spin :spinning="loading">
      <s-table
        :data="loadData"
        :columns="columns"
      >

      </s-table>
    </a-spin>
  </a-modal>
</template>

<script>
import { getLogsList } from '@/api/cabinet'
import { STable } from '@/components'
export default {
  name: 'LogsComponent',
  data () {
    this.formLayout = {
      labelCol: {
        span: 6
        // xs: { span: 24 },
        // sm: { span: 7 }
      },
      wrapperCol: {
        span: 18
        // xs: { span: 24 },
        // sm: { span: 13 }
      }
    }
    return {
      columns: [
        {
          title: 'id',
          dataIndex: 'id'
        }
      ],
      loadData: (paramter) => {
        return getLogsList().then(res => {
          return {
            data: res.data
          }
        })
      },
      modalStatus: 0, // 0 更新 1 添加
      result: [
        '1',
        '2'
      ],
      autoValue: '',
      mapResultDataSource: [
        {
          title: '',
          address: '',
          uid: ''
        }
      ],
      BMap: null,
      map: null,
      keyword: '浦东幼儿园',
      location: '中国',
      detailData: null,
      mapCenter: {
        lng: 0,
        lat: 0
      },
      form: this.$form.createForm(this, { id: 10000 })
    }
  },
  props: {
    title: {
      type: String,
      required: true,
      default: '详情'
    },
    update: {
      type: Boolean,
      required: true,
      default: true
    },
    visible: {
      type: Boolean,
      required: true
    },
    loading: {
      type: Boolean,
      default: () => false
    },
    model: {
      type: Object,
      default: () => null
    }
  },
  created () {
    if (this.update) {
      this.init()
    }
  },
  components: {
    STable
  },
  methods: {
    init () {
    },
    modalOK () {
      // this.$form.submit
    },
    formSubmit () {
      alert('123')
    },
    cancelModal () {
      this.$emit('cancel')
      // () => { this.$emit('cancel') }
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
